﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
//using 数据库;
using MySql.Data.MySqlClient;

public partial class 分类_75_数据库_1_Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string strConnString = "server=localhost;user id=root; pooling=false;charset=gb2312; password=";
        string sql ="select * from test.a";
        



        MySqlConnection con = new MySqlConnection(strConnString);
        con.Open();

       
        //MySqlCommand com = new MySqlCommand();
        //com.Connection = con;
        //com.CommandText = sql;
        MySqlDataAdapter ada = new MySqlDataAdapter(sql,con);
        //ada.SelectCommand = com;

        MySqlCommandBuilder mcb = new MySqlCommandBuilder(ada);

        DataSet ds = new DataSet();
        ada.Fill(ds,"a");
        //com.Dispose();
        DataTable dt = new DataTable();
        dt = ds.Tables[0];
        
        //con.Close();


        this.GridView1.DataSource = dt;
        this.GridView1.DataBind();



        dt.Rows[1]["m"] = "5";

        ada.Update(ds,"a");

        

    }
}
